package thread.lock;

/**
 * @program: Multhread
 * @description: 内嵌方法可重入
 * @author: zhanghz001
 * @create: 2021-03-04 21:30
 **/
public class NestedLock {
    public static void main(String[] args) {
        NestedLock lock = new NestedLock();
        lock.f2();
    }
    
    private synchronized void f2() {
        f1();
        System.out.println("f2");
    }
    
    private synchronized void f1() {
        System.out.println("f1");
    }
}
